//
//  JiLuTVCell.m
//  HxgProject
//
//  Created by hxg on 2018/4/1.
//  Copyright © 2018年 XMYY-19. All rights reserved.
//

#import "JiLuTVCell.h"

@implementation JiLuTVCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self)
    {
        [self setUpUI];
    }
    return self;
}


- (void)setUpUI
{
//    UILabel *tempSerLbl = [[UILabel alloc] init];
//    tempSerLbl.text = @"服务费用:";
//    [self.contentView addSubview:tempSerLbl];
    
    UILabel *tempApplyZhouQiLbl = [[UILabel alloc] init];
    tempApplyZhouQiLbl.text = @"申请周期:";
    [self.contentView addSubview:tempApplyZhouQiLbl];
    
    UILabel *tempApplyTimeLbl = [[UILabel alloc] init];
    tempApplyTimeLbl.text = @"申请时间:";
    [self.contentView addSubview:tempApplyTimeLbl];
    [tempApplyZhouQiLbl makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.mas_left).offset(15.0f);
        make.top.equalTo(self.contentView.mas_top).offset(10.0f);
    }];
    
    [tempApplyTimeLbl makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(tempApplyZhouQiLbl.mas_left);
        make.top.equalTo(tempApplyZhouQiLbl.mas_bottom).offset(15.0f);
    }];
    
    self.applyZhouqiLbl = [[UILabel alloc] init];
    self.applyZhouqiLbl.text = @"7天";
    [self.contentView addSubview:self.applyZhouqiLbl];
    [self.applyZhouqiLbl makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(tempApplyZhouQiLbl.mas_right).offset(3.0f);
        make.centerY.equalTo(tempApplyZhouQiLbl.mas_centerY);
    }];
    
    self.applyTimeLbl = [[UILabel alloc] init];
    self.applyTimeLbl.text = @"1992-224-0320";
    self.applyTimeLbl.numberOfLines = 2;
    [self.contentView addSubview:self.applyTimeLbl];
    [self.applyTimeLbl makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(tempApplyTimeLbl.mas_right).offset(3.0f);
        make.centerY.equalTo(tempApplyTimeLbl.mas_centerY);
        make.width.mas_equalTo(150.0f);
    }];
    
#pragma mark - 当前状态、申请金额
    UILabel *tempCurStateLbl = [[UILabel alloc] init];
    tempCurStateLbl.text = @"当前状态";
    [self.contentView addSubview:tempCurStateLbl];
    [tempCurStateLbl makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(tempApplyZhouQiLbl.mas_centerY);
        make.left.equalTo(self.contentView.mas_centerX).offset(20.0f);
    }];
    
    self.curStateLbl = [[UILabel alloc] init];
    self.curStateLbl.font = [UIFont systemFontOfSize:28.0f];
    self.curStateLbl.text = @"进行中";
    self.curStateLbl.textAlignment = NSTextAlignmentRight;
    [self.contentView addSubview:self.curStateLbl];
    [self.curStateLbl makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(tempApplyTimeLbl.mas_centerY);
        make.right.equalTo(tempCurStateLbl.mas_right);
    }];
    
    UILabel *tempApplyNumLbl = [[UILabel alloc] init];
    tempApplyNumLbl.text = @"申请金额";
    [self.contentView addSubview:tempApplyNumLbl];
    [tempApplyNumLbl makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(tempCurStateLbl.mas_centerY);
        make.left.equalTo(tempCurStateLbl.mas_right).offset(20.0f);
    }];
    
    self.applyNumLbl = [[UILabel alloc] init];
    self.applyNumLbl.textColor = mainColor;
    self.applyNumLbl.font = [UIFont systemFontOfSize:28.0f];
    self.applyNumLbl.text = @"1000";
    self.applyNumLbl.textAlignment = NSTextAlignmentRight;
    [self.contentView addSubview:self.applyNumLbl];
    [self.applyNumLbl makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.curStateLbl.mas_centerY);
        make.left.equalTo(tempApplyNumLbl.mas_left);
    }];
}


- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
